FUNCTION
privkey_to_pubkey
function privkey_to_pubkey(privkey: byte_array, [compressed: boolean]): byte_arrayCompute a public key from a 32-byte private key.
The optional boolean flag compressed determines whether a compressed (33-byte), or uncompressed
(65-byte) public key, is returned. Defaults to false (uncompressed) if not provided.
Parameters
- privkey — the 32-byte private key
- compressed — whether or not the public should be compressed; defaults to false (uncompressed)
Returns
a 65-byte public key in uncompressed mode, or a 33-byte public key in compressed mode
Throws
exception— ifprivkeyis not32bytes
Since
0.10.6
© 2026 Chromia